<template>
  <div class="hm-cover-card">
    <div class="">
      <div class="ft">
        <div class="body" @click="preImg(options.mainImgArray[0])">
          <!--          <image  class="entryPic" :src="options.mainImg+'?imageView2/1/w/200/h/200/q/75'"/>-->

          <u-image class="flex  f-s-0 w-120 h-100 bg-img b-radius-10" border-radius="14px"
                   :src="options.mainImgArray[0]+'?'+globalImageProcessingSuffix" alt="">
            <view slot="error" style="font-size: 24rpx;">
              <u-image class="flex  f-s-0 w-100 h-80 bg-img b-radius-10" border-radius="14px"
                       :src="'https://img.fscmkjznb.com/static/noImg.jpeg'+'?'+globalImageProcessingSuffix" alt=""/>
            </view>
          </u-image>
        </div>
        <div class="wrap">
          <view class="info" style="width: 100px;margin-top: -12px">
            <span style="word-wrap: break-word;" :class="DataLength">{{ options.title }}</span>
          </view>

          <view class="price">
            <view class="text">￥{{ options.price }}</view>
            <view style="display: flex;">

              <view style="font-size: 10px">分销比例:{{ options.distributioRatio ? options.distributioRatio : 0 }}
              </view>
              <view style="font-size: 10px;margin-left: 10px">
                分销金额:{{ options.price * (options.distributioRatio ? options.distributioRatio : 0) }}
              </view>
            </view>

          </view>

        </div>
        <div class="shoucangWrap">
          <text style="color: #9c1712">热</text>
        </div>
      </div>

    </div>
  </div>
</template>
<script>


export default {
  components: {},
  name: 'HmCoverCard',
  props: {
    dataId: {
      type: String,
      default: 'hm-cover-card'
    },
    options: {
      type: Object,
      default: {}
    }
  },
  created() {
    this.title = this.options.title
    this.globalImageProcessingSuffix = getApp().globalData.globalImageProcessingSuffix;
  },
  computed: {
    DataLength() {
      if (this.options.title.length > 10) {
        return 'SMALLFONT'
      }
    },
  },
  data() {
    return {
      title:"",
      globalImageProcessingSuffix: '',
    };
  },
  methods: {
    preImg(item) {
      uni.previewImage({
        urls: [item], // 需要预览的图片链接列表
      });
    },
    chooseItem(item) {
      this.$emit("clickItem", item)
    }
  }
};
</script>
<style>
@import 'index.response.css';

.SMALLFONT {
  font-size: 11px !important;
}


</style>
